<!DOCTYPE html>
<html>
<head>
<include file="Include:meta" />
<title>人员需求管理-目的地运营集团数据管理平台</title>
<include file="Include:style" />
<style>
	.folder span{ display: inline-block; margin: 0 40px 0 1px; }
</style>
</head>
<body>
<include file="Include:header" />
<include file="Include:left" />
<div id="main">
	<div class="crumbs">
		<div class="crumbs-text">人员需求管理</div>
		<if condition="is_permission('XQ',NULL,1)">
		<div class="right">
			<a href="__APP__/Hr/person_demand_add" class="btn">添加人员需求</a>
		</div>
		</if>
	</div>
	<div id="content">
		<div class="">
			<table class="table table-bordered">
				<tr class="table-header fixed-table-header">
					<td>申请单编号</td>
					<td>申请职位</td>
					<td>申请人数</td>
					<td>岗位职级</td>
					<td>汇报对象</td>
					<td>岗位所属部门</td>
					<td>是否关键岗位</td>
					<td>申请日期</td>
					<td>申请人(日期)</td>
					<td>状态</td>
					<td>当前环节人员</td>
					<if condition="is_permission('XQ',NULL,1)">
					<td>管理</td>
					</if>
				</tr>
				<if condition="$result eq NULL">
				<tr>
					<td <if condition="is_permission('XQ',NULL,1)">colspan="12"<else />colspan="11"</if> class="text-center">暂无相关内容</td>
				</tr>
				</if>
				<foreach name="result" item="vo">
					<tr class="interlaced-color">
						<td><a href="__APP__/Hr/person_demand_detail/id/{$vo['id']}">{$vo['order_number']}</a></td>
						<td>{$vo['position_user']}</td>
						<td>{$vo['number']}</td>
						<td>{$vo['rank']}</td>
						<td>{$vo['report_user']}</td>
						<td>{$vo['department_name']}</td>
						<td>{$vo['is_position']}</td>
						<td>{$vo['sq_date']}</td>
						<td>{$vo['add_user']}({$vo['add_date']|substr=0,10})</td>
						<td rowspan="{$vo['sum']}" style="padding:0" class="ding">
							<div class="project_user_alert">
								<if condition="$vo['status'] eq -1">未提交<if condition="$vo['dh_uid'] neq NULL"><span title="{$vo['dh_user']}({$vo['dh_date']|substr=0,10}):{$vo['dh_message']}" data-placement="left" data-toggle="tooltip" class="red">(已打回)<span></if>
								<elseif condition="$vo['status'] eq 6"/>已完结<i class="glyphicon glyphicon-exclamation-sign ml10" style="color:#999"></i>
								<else />
								进行中<i class="glyphicon glyphicon-exclamation-sign ml10" style="color:#999"></i>
								</if>
								<if condition="$vo['status'] gt -1">
								<div class="project_user_box">
									<if condition="$vo['status'] neq -1">
										<div class="project_user_title">审核流程</div>
										<foreach name="vo['audit_arr']" item="vv">
											<div class="p"><span class="bold">{$vv['audit_name']}</span>
											<if condition="$vv['audit_date'] neq NULL">
												<span>{$vv['audit_user']}({$vv['audit_date']|substr=0,10})<if condition="$vv['audit_comments'] neq NULL">:{$vv['audit_comments']}</if></span>
												<if condition="$vv['dh_message'] neq NULL"><br/><span>打回至"{$vv['arrive_name']}"({$vv['dh_date']|substr=0,10})原因:{$vv['dh_message']}</span></if><if condition="$vv['arrive_info'] neq NULL"><br/><span>"{$vv['arrive_name']}"({$vv['arrive_date']|substr=0,10})回复:{$vv['arrive_info']}</span></if>
											<else/>
												<span class='red'>[未审核]{$vv['audit_user']}</span>
												<if condition="$vv['dh_message'] neq NULL"><br/><span class='red'>打回至"{$vv['arrive_name']}"({$vv['dh_date']|substr=0,10})原因:{$vv['dh_message']}</span></if><if condition="$vv['arrive_info'] neq NULL"><br/><span class='red'>"{$vv['arrive_name']}"({$vv['arrive_date']|substr=0,10})回复:{$vv['arrive_info']}</span></if>
											</if>
											</div>
										</foreach>
									</if>
									<!--<if condition="$vo['dh_uid'] neq NULL">
										<div class="p"><span class="red bold">打回原因 </span><span class="red">{$vo['dh_user']}({$vo['dh_date']|substr=0,10}):{$vo['dh_message']}</span></div>
									</if>
									<if condition="$vo['submit_info'] neq NULL">
										<div class="p"><span class="red bold">重新提交 </span><span class="red">{$vo['submit_user']}:{$vo['submit_info']}</span></div>
									</if>-->
								</div>
								</if>
							</div>
						</td>
						<td rowspan="{$vo['sum']}"><if condition="$vo['audit_user'] neq NULL">{$vo['audit_user']}<else />无</if></td>
						<if condition="is_permission('XQ',NULL,1)">
						<td>
							<if condition="$vo['status'] eq -1">
								<if condition="$vo['dh_message'] neq ''">
									<a href="javascript:;" mid="{$vo['tid']}" uuid="{$login_id}" data-toggle="tooltip" data-placement="left" title="重新提交" class="btn-rest-submit mr5"><i class="glyphicon glyphicon-ok"></i></a>
								<else/>
									<a href="javascript:;" mid="{$vo['tid']}" uuid="{$login_id}" data-toggle="tooltip" data-placement="left" title="提交" class="btn-submit mr5"><i class="glyphicon glyphicon-ok"></i></a>
								</if>
								<a href="__APP__/Hr/person_demand_edit/id/{$vo['id']}" class="mr5" data-toggle="tooltip" data-placement="left" title="编辑"><i class="glyphicon glyphicon-edit"></i></a>
								<a href="javascript:;" mid="{$vo['id']}" action="delete" data-toggle="tooltip" data-placement="left" title="删除" class="btn-delete"><i class="glyphicon glyphicon-trash"></i></a>
							<elseif condition="$vo['status'] eq 1"/>
								<a href="javascript:;" mid="{$vo['tid']}" data-toggle="tooltip" data-placement="left" title="放弃提交" class="btn-remove"><i class="glyphicon glyphicon-remove"></i></a>
							</if>
							
						</td>
						</if>
					</tr>
				</foreach>
			</table>
		</div>
	</div>
</div>
<!--重新提交框-->
<div class="modal fade" id="myModal_submit">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<h4>重新提交</h4>
				<i class="fa fa-times" aria-hidden="true" data-dismiss="modal"></i>
			</div>
			<div class="modal-body">
				<table class="table table-bordered">
					<tr>
						<td class="text-right"><strong><span class="asterisk">*</span>原因</strong></td>
						<td>
							<textarea name="remark" placeholder="重新提交理由" class="form-control w300 submit_info left" autocomplete="off"></textarea>
							<span class="error-item left">必填项</span>
						</td>
					</tr>
				</table>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-affirm">确认</button>
				<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
			</div>
		</div>
	</div>
</div>
<include file="Include:javascript"/>
<script type="text/javascript">
$(function(){
	$(".classify_select").on('change',function(){
		if($(this).val()==-10){
			$(this).nextAll('input').val('').show();
		}else{
			$(this).nextAll('input').val('').hide();
		}
	});
	//删除
	$(".btn-delete").ajaxModal({"title_text":"确认提示框","body_text":"您确定要删除吗？","url":"__APP__/Hr/person_demand_ajax","data":{"id":"mid","action":"action"}});
	$('.btn-submit').on("click",function(){
		var status = 1,
			uuid = $(this).attr("uuid"),
			state = 1,
			mid = $(this).attr("mid");
		$.ajax({
			cache:true,
			type:"POST",
			dataType:"json",
			url:"__APP__/Index/audit_list_ajax",
			data:{"mid":mid,"status":status,"uuid":uuid,"state":state,"type":"7"},
			success:function(data){
				success_pop(data['status'],data['msg']);
			}
		});
	});
	$('.btn-remove').on("click",function(){
		var status = -1,
			state = 1,
			mid = $(this).attr("mid");
		$.ajax({
			cache:true,
			type:"POST",
			dataType:"json",
			url:"__APP__/Index/audit_list_ajax",
			data:{"mid":mid,"status":status,"state":state,"type":"7"},
			success:function(data){
				success_pop(data['status'],data['msg']);
			}
		});
	});
	/*重新提交*/
	$(".btn-rest-submit").click(function(){
		var mid = $(this).attr("mid"),
			uuid = $(this).attr("uuid");

		$("#myModal_submit .btn-affirm").attr("mid",mid);
		$("#myModal_submit .btn-affirm").attr("uuid",uuid);
		$(".submit_info").removeClass("red").val("");
		$('#myModal_submit').modal('toggle');
	});
	
	$("#myModal_submit .btn-affirm").click(function(){
		var mid = $(this).attr("mid"),
			uuid = $(this).attr("uuid"),
			status = 1,
			state = 1,
			submit_info = $(".submit_info").val();

		if(submit_info==""||submit_info=="重新提交理由必填"){
			$(".submit_info").addClass("red").val("重新提交理由必填");
		}else{
			$('#myModal_submit').hide();
			$.ajax({
				cache:true,
				type:"POST",
				dataType:"json",
				global: false,
				url:"__APP__/Index/audit_list_ajax",
				data:{"mid":mid,"status":status,"uuid":uuid,"state":state,"type":"7","submit_info":submit_info},
				success:function(data){
					success_pop(data['status'],data['msg']);
				}
			});
		}
	});

	$(".submit_info").focus(function(){
		if($(this).val()=="重新提交理由必填"){
			$(this).removeClass("red").val("");
		}
	});
});
</script>
</body>
</html>